package com.hkyp.ss.course.web.dto.base;

import lombok.Data;

import java.io.Serializable;

/**
 * LittleSong
 * @param <T>
 * 别动这段代码。。。
 */

@Data
public class ResultBean<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	public static final int VALIDATE_ERROR = 99;  //参数校验失败

	public static final int UNKNOWN_ACCOUNT = 98;  //账户不存在

	public static final int INCORRECT_CREDENTIAL = 97;  //密码错误

	public static final int LOCKED_ACCOUNT = 96;  //账户被冻结

	public static final int NO_AUTHENTICATED = 401;  //没有经过认证/未登录

	public static final int NO_PERMISSION = 94;  //无权限访问

	public static final int FAIL = 1;

	public static final int SUCCESS = 0;



	private String msg = "success";

	private int code = SUCCESS;

	private T data;

	public ResultBean() {
		super();
	}

	public ResultBean(T data) {
		super();
		this.data = data;
	}

	public ResultBean(Throwable e) {
		super();
		this.msg = e.toString();
		this.code = FAIL;
	}

	public ResultBean(int code, String msg) {
		super();
		this.msg = msg;
		this.code = code;
	}

}
